<template>
	<view>
		<u-empty :mode="mode" :text="payText"/>
	</view>
</template>

<script>
	import {paypalCaptureOrder} from '@/common/http.api.js'
	export default {
		data() {
			return {
				id:'',
				channelId:'',
				payText:'',
				status:'fail',
				mode:'',
				payType:'paypal',
			};
		},
		onShow(){
		    this.refresh();	
		},
		onLoad(e) {
			this.id = e.id;
			this.status = e.status;
			this.channelId = e.channelId;
			console.info('支付状态：'  + this.status);
			if(this.status === 'fail'){
				this.mode = 'data';
				this.payText = this.$t('common.pay.fail');
			} else {
				this.mode = 'car';
				this.payText = this.$t('common.pay.success');
			}
			if(this.payType === 'paypal'){
				this.doPaypalCaptureOrder();
			}
			uni.setNavigationBarTitle({
			　　title:this.payText
			})
		},
		methods:{
			refresh(){
				
			},
			doPaypalCaptureOrder(){
				paypalCaptureOrder({params:{token:this.id,channelId:this.channelId}})
			}
		}
	}
</script>

<style lang="scss">

</style>
